package com.muyu.vehicle.entity;

import com.fasterxml.jackson.annotation.JsonProperty;

import java.util.Map;

/**
 * @program: wukong_travel
 * @author: 段帅虎
 * @description:
 * @create: 2024-09-19 11:52
 */
public class RowData {
    @JsonProperty("rowKey")
    private String rowKey;
    @JsonProperty("data")
    private StringBuilder data;
    @JsonProperty("map")
    private Map<String, Object> map;

    public RowData(String rowKey) {
        this.rowKey = rowKey;
        this.data = new StringBuilder();
    }

    public Map<String, Object> getMap() {
        return map;
    }

    public void setMap(Map<String, Object> map) {
        this.map = map;
    }

    public void addColumn(String column, String value) {
        if (data.length() > 0) {
            data.append(", ");
        }
        data.append(column).append("=").append(value);
    }

    public String getRowKey() {
        return rowKey;
    }

    public void setRowKey(String rowKey) {
        this.rowKey = rowKey;
    }

    public StringBuilder getData() {
        return data;
    }

    public void setData(StringBuilder data) {
        this.data = data;
    }


    @Override
    public String toString() {
        return rowKey + ": " + data.toString();
    }
}
